var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function i() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, 
    new i());
}), a = this && this.__decorate || function(e, t, o, i) {
    var r, n = arguments.length, p = n < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) p = Reflect.decorate(e, t, o, i); else for (var c = e.length - 1; 0 <= c; c--) (r = e[c]) && (p = (n < 3 ? r(p) : 3 < n ? r(t, o, p) : r(t, o)) || p);
    return 3 < n && p && Object.defineProperty(t, o, p), p;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameBlock"), s = e("HpView"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.HP = 4e3, e.hpView = null, e;
    }
    return i(e, t), e.prototype.start = function() {
        this.hpView.init(this.HP), this.hideHp();
    }, e.prototype.hurt = function(e) {
        var t = e.player;
        if (t) {
            t.gameView.appendCri(e.type, this.node.getPosition(), 1e3, !1);
            e = this.doHurt(1e3);
            if (this.showHp(), e) return this.doEffect(), this.doDestroy(), t.gameView.node.emit("block_destory"), 
            !0;
        }
        return !1;
    }, e.prototype.showHp = function() {
        this.unschedule(this.hideHp), this.hpView.node.active = !0, this.hpView.refresh(this.HP), 
        this.scheduleOnce(this.hideHp, 2);
    }, e.prototype.hideHp = function() {
        this.hpView.node.active = !1;
    }, a([ d(s.default) ], e.prototype, "hpView", void 0), a([ l ], e);
}(r.default);

n.default = u;